package com.vdcloud.mcclassroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vdcloud.mcclassroom.entity.User;
import com.vdcloud.mcclassroom.mapper.UserMapper;
import com.vdcloud.mcclassroom.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author 宋发准
 * @since 2019-12-24
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User getLoginUserByUserAccount(String userPhone) {
        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(User::getUserPhone, userPhone);
        //todo:暂时注释
        //wrapper.eq(User::getUserStatus, "1");
        User user = this.getOne(wrapper, false);
        return user;
    }
}
